<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="format-detection" content="telephone=no"/>
<meta name="wap-font-scale" content="no">
<meta name="renderer" content="webkit">
<title>AutoCode</title>
<link rel="shortcut icon" href="/favicon.ico" />
<script src="/links/jquery/jquery-3.5.1.min.js"></script>
<script src="/links/polyfill.min.js"></script>
<script src="/links/axios/axios.min.js"></script>
<script src="/links/vue/vue.min.js"></script>
<script src="/links/element-ui/index.js"></script>
<script src="/links/dayjs.min.js"></script>
<script src="/links/echarts/echarts.js"></script>
<script src="/links/JsBarcode.all.js"></script>
<script src="/links/qrcode.min.js"></script>
<script src="/links/layer/layer.js"></script>
<script src="/links/crypto/crypto-js.js"></script>
<script src="/js/dragController.js"></script>
<script src="/js/HttpApi.js"></script>
<script src="/js/AutoCode.js"></script>
<link href="/links/element-ui/theme/index.css" rel="stylesheet"/>
<link href="/css/default.css" rel="stylesheet"/>
<link href="/css/dragController.css" rel="stylesheet"/>
    
    <style>
        
    </style>
</head>
<body>
<div id="app"  class="box " >
<div class="flex ac-form-head ac-form-oper-head-line">
    <div class="ac-form-title">{{dingTalkConfig.title}}</div>
    <div class="ac-form-oper"><el-button size="medium"  v-if="dingTalkConfig.operVisible.edit" @click="dingTalkConfig_editDingTalkConfigAdd()" :disabled="dingTalkConfig.operDisabled.edit"  type="text"     native-type="button">设置信息(E)</el-button>
</div>
</div>
<div class="ac-form-content">
            <el-form class="ac-form-detail"  :show-message="false"  label-width="190px" label-position="right"
     size="mini" ref="dingTalkConfig" :model="dingTalkConfig.data" :rules="dingTalkConfig.rules"  
     :disabled="dingTalkConfig.disabled" @submit.native.prevent>
    <el-row><el-col :span=24 v-if="dingTalkConfig.itemVisible.corpId">
    <el-form-item prop="corpId" label="CorpId（组织机构信息）">
        {{dingTalkConfig.data.corpId}}

    </el-form-item>
</el-col>
<el-col :span=24 v-if="dingTalkConfig.itemVisible.appId">
    <el-form-item prop="appId" label="AppId（应用信息）">
        {{dingTalkConfig.data.appId}}

    </el-form-item>
</el-col>
<el-col :span=24 v-if="dingTalkConfig.itemVisible.clientId">
    <el-form-item prop="clientId" label="Client ID（应用信息）">
        {{dingTalkConfig.data.clientId}}

    </el-form-item>
</el-col>
<el-col :span=24 v-if="dingTalkConfig.itemVisible.clientSecret">
    <el-form-item prop="clientSecret" label="Client Secret（应用信息）">
        {{dingTalkConfig.data.clientSecret}}

    </el-form-item>
</el-col>
<el-col :span=24 v-if="dingTalkConfig.itemVisible.robotCode">
    <el-form-item prop="robotCode" label="RobotCode（机器人信息）">
        {{dingTalkConfig.data.robotCode}}

    </el-form-item>
</el-col>
</el-row>
 </el-form>

</div>
<el-dialog :visible.sync="dingTalkConfigAdd.visible" :title="dingTalkConfigAdd.title"
            width="50%"
                
            :close-on-click-modal="false"
            :close-on-press-escape="false">
            <div style="width:100%;">
                <el-form class=""  :show-message="false"  label-width="190px" label-position="right"
     size="mini" ref="dingTalkConfigAdd" :model="dingTalkConfigAdd.data" :rules="dingTalkConfigAdd.rules"  
     :disabled="dingTalkConfigAdd.disabled" @submit.native.prevent>
    <el-row><el-col :span=24 v-if="dingTalkConfigAdd.itemVisible.corpId">
    <el-form-item prop="corpId" label="CorpId（组织机构信息）">
        
<el-input type="text" size="mini"  v-model="dingTalkConfigAdd.data.corpId" placeholder="CorpId（组织机构信息）" :disabled="dingTalkConfigAdd.itemDisabled.corpId"  @keyup.enter.native="dingTalkConfigAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="dingTalkConfigAdd.itemVisible.appId">
    <el-form-item prop="appId" label="AppId（应用信息）">
        
<el-input type="text" size="mini"  v-model="dingTalkConfigAdd.data.appId" placeholder="AppId（应用信息）" :disabled="dingTalkConfigAdd.itemDisabled.appId"  @keyup.enter.native="dingTalkConfigAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="dingTalkConfigAdd.itemVisible.clientId">
    <el-form-item prop="clientId" label="Client ID（应用信息）">
        
<el-input type="text" size="mini"  v-model="dingTalkConfigAdd.data.clientId" placeholder="Client ID（应用信息）" :disabled="dingTalkConfigAdd.itemDisabled.clientId"  @keyup.enter.native="dingTalkConfigAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="dingTalkConfigAdd.itemVisible.clientSecret">
    <el-form-item prop="clientSecret" label="Client Secret（应用信息）">
        
<el-input type="text" size="mini"  v-model="dingTalkConfigAdd.data.clientSecret" placeholder="Client Secret（应用信息）" :disabled="dingTalkConfigAdd.itemDisabled.clientSecret"  @keyup.enter.native="dingTalkConfigAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="dingTalkConfigAdd.itemVisible.robotCode">
    <el-form-item prop="robotCode" label="RobotCode（机器人信息）">
        
<el-input type="text" size="mini"  v-model="dingTalkConfigAdd.data.robotCode" placeholder="RobotCode（机器人信息）" :disabled="dingTalkConfigAdd.itemDisabled.robotCode"  @keyup.enter.native="dingTalkConfigAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
</el-row>
 </el-form>

            </div>
            <div class="dialog-footer" slot="footer">    <el-button size="mini" @click="dingTalkConfigAdd_dialogOk()"  type="primary"      native-type="button">确 定</el-button>
    <el-button size="medium" @click="dingTalkConfigAdd_dialogCancel()"  type="text"      native-type="button">取 消</el-button>
</div>
</el-dialog>


</div>

</body>
<script th:inline="javascript">
    let vm = new Vue({
            el: '#app',
            data() {
                return {"dingTalkConfig":{"title":"钉钉设置","data":{},"operData":{},"operVisible":{"edit":true},"operDisabled":{},"disabled":false,"editorForm":true,"itemVisible":{"corpId":true,"clientId":true,"appId":true,"clientSecret":true,"robotCode":true},"itemDisabled":{},"transfer":{},"rules":{}},"page":{},"tabDisabled":{},"tabVisible":{},"customOptions":{},"dictOptions":{},"dingTalkConfigAdd":{"visible":false,"title":"钉钉设置","data":{},"operData":{},"operVisible":{},"operDisabled":{},"disabled":false,"editorForm":true,"itemVisible":{"corpId":true,"appId":true,"clientId":true,"clientSecret":true,"robotCode":true},"itemDisabled":{},"transfer":{},"rules":{}}}
            },
            watch: {
},
            methods: {
dingTalkConfigAdd_load:function(){
    let that = this;
    HttpApi.queryObject("dingtalkConfig",this.dingTalkConfigAdd.operData,function(res){
        that.dingTalkConfigAdd.data = res;
    });
},
dingTalkConfigAdd_dialogCancel:function(){
     this.dingTalkConfigAdd.visible = false;
},
dingTalkConfigAdd_change:function(fieldName){
    HttpApi.updateProvider("dingtalkConfig",fieldName,this.dingTalkConfigAdd.data,function(){

    });
},
dingTalkConfigAdd_dialogOk:function(){
    let that = this;
    this.$refs.dingTalkConfigAdd.validate(function(valid){
        if(valid){
            that.dingTalkConfigAdd.callback(that.dingTalkConfigAdd.data);
        }else{
            return false;
        }
    });
},
dingTalkConfigAdd_dialogOpen:function(param,callback){
    this.$data.dingTalkConfigAdd.data = this.$options.data().dingTalkConfigAdd.data;
    this.$data.dingTalkConfigAdd.operData = this.$options.data().dingTalkConfigAdd.operData;
    for(let val in param) {
        this.$set(this.dingTalkConfigAdd.data, val, param[val])
    }
    this.dingTalkConfigAdd.callback=callback;
    this.dingTalkConfigAdd.visible = true;
}
,
dingTalkConfig_change:function(fieldName){
    HttpApi.updateProvider("dingtalkConfig",fieldName,this.dingTalkConfig.data,function(){

    });
},
dingTalkConfig_load:function() {
    let that = this;
    HttpApi.post2("/platform/dingTalk/detail", this.dingTalkConfig.operData, function(res) {
        that.dingTalkConfig.data = res;
    });
},
dingTalkConfig_editDingTalkConfigAdd: function() {
     let that = this;
     this.dingTalkConfigAdd.editorForm = true;
     let param = {};
     param.id = this.dingTalkConfig.data.id;
     this.dingTalkConfigAdd_dialogOpen(param, function(dialogData) {
         HttpApi.post("/platform/dingTalk/saveConfig", dialogData, function(res) {
             that.dingTalkConfig.data = res;
             that.dingTalkConfigAdd.visible = false;
         });
     })
 }
},
            mounted: function(){
    dragControllerLR();
    dragControllerUD();
},
            created: function(){
    let that=this;
    //获取字典信息
    HttpApi.dictOptions([],function(res){
        that.dictOptions=res;
    });

    //加载自定义数据字典
    

    //加载初始化load
    this.dingTalkConfig_load();


    //加载初始化方法
    
}
    });
    

    
</script>
</html>
